package com.gulimall.api.feign;

import com.gulimall.api.fallback.WareClientImpl;
import com.gulimall.common.core.domain.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;


@FeignClient(value = "gulimall-ware",fallback = WareClientImpl.class)
public interface WareClient {
    /**
     * 查询商品库存
     */
    @GetMapping("/ware/wareSku/getProductStock")
    Result getProductStock(@RequestParam("skuId") Long skuId);
    /**
     * 扣减库存
     */
    @GetMapping("/ware/wareSku/reduceWare/{skuId}/{count}")
    Result reduceWare(@PathVariable("skuId") Long skuId,
                      @PathVariable("count") Integer count);
}
